<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let unm = 22;
        //1.模运算，取余
        console.log(unm % 5);



        //2.精度失真：计算机的本质是二进制，
        //计算机需要转化为二进制，再进行算术运算，结果转化为十进制。
        // https://www.ruanyifeng.com/blog/2010/06/ieee_floating-point_representation.html
        console.log(7 * 100);//700
        console.log(0.1 + 0.2);//0.30000000000000000004
        console.log(0.07 * 100);//7.000000000000000001



        //3.精度失真给计算带来巨大问题.
        //java-bigdecimal；mysql-decimal

        //4.number  17位溢出（订单编号使用字符串）
        console.log(1234567890123456789);


        //5.toFixed() 保留几位小数
        let num1 = 3.1415;
        console.log(num1.toFixed(2));




        
        //转化为字符串
        let num = 1234567890123456789;
        num = num.toString();
        console.log(typeof num);
 

    </script>


</body>

</html>